//HashRouter:有#号
//BrowserRouter:没有#号
//Switch:只要匹配到一个地址不往下匹配
//Link:跳转页面，相当于vue中router-link
//exact:完全匹配
import React from 'react'
import {HashRouter as Router,Route,Switch} from 'react-router-dom'
// import {PrivateRoute} from './private'
// import HomeComponents from '../pages/home/Home'
import App from '../App'
import TabBarComponents from '../components/tabBar/index'
// import CartComponents from '../pages/cart/Cart'
// import ProfileComponents from '../pages/profile/Profile'
import LoginComponents from '../pages/profile/Login'
import RegComponents from '../pages/profile/Reg'
import UserInfoComponent from '../pages/profile/UserInfo'
import ClassifyComponent from '../pages/home/Classify'
import DetailComponent from '../pages/home/Detail'
import MyCartComponent from '../pages/profile/MyCart'
import SetPwdComponent from '../pages/profile/SetPwd'
import BindComponent from '../pages/profile/Bind'
import SiteComponent from  '../pages/profile/Site'
import AddSiteComponent from '../pages/profile/AddSite'
import OrderComponents from '../pages/cart/Order'
import SucceedComponents from '../pages/cart/Succeed'
import AllOrderComponents from '../pages/profile/AllOrder'
import OrderInfoComponents from '../pages/profile/OrderInfo'
export default class RouterComponent extends React.Component{
    render() {
        return(
            <React.Fragment>
                <Router>
                    <React.Fragment>
                        <Switch>
                            <Route exact path='/' component={TabBarComponents}></Route>
                            {/*<Route path='/cart' component={CartComponents}></Route>*/}
                            <Route path='/profile/order/info' component={OrderInfoComponents}></Route>
                            <Route path='/profile/allorder' component={AllOrderComponents}></Route>
                            <Route path='/cart/order/succeed' component={SucceedComponents}></Route>
                            <Route path='/login' component={LoginComponents}></Route>
                            <Route path='/reg' component={RegComponents}></Route>
                            <Route path='/profile/userinfo' component={UserInfoComponent}></Route>
                            <Route path='/home/classify' component={ClassifyComponent}></Route>
                            <Route path='/detail' component={DetailComponent}></Route>
                            <Route path='/profile/myCart' component={MyCartComponent}></Route>
                            <Route path='/profile/setPwd' component={SetPwdComponent}></Route>
                            <Route path='/profile/bind' component={BindComponent}></Route>
                            <Route path='/profile/site' component={SiteComponent}></Route>
                            <Route path='/profile/siteAdd' component={AddSiteComponent}></Route>
                            <Route path='/cart/order' component={OrderComponents}></Route>
                            {/*<PrivateRoute path='/profile' component={ProfileIndex}></PrivateRoute>*/}

                        </Switch>
                    </React.Fragment>
                </Router>
            </React.Fragment>
        )
    }
}